package com.zxl.config;

import com.zxl.intecepter.DataSourceInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.mvc.WebContentInterceptor;

/**
 * @packageName com.zxl.config
 * @ClassName
 * @Author zxl
 * @Description //TODO
 * @date
 **/
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Autowired
    private DataSourceInterceptor dataSourceInterceptor;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(dataSourceInterceptor)
                .addPathPatterns("/**");
    }
}
